<template>
  <div id="app">
    <Province :data="data" :activeIndex="activeIndex" @changeActiveIndex="changeActiveIndex"/>
    <City :list="data[activeIndex].city"/>
  </div>
</template>

<script>
const data = require("./check.json");
import Province from './components/Province.vue'
import City from './components/City.vue'
data.forEach(v => {
  v.city.forEach(v => {
    v.isChecked = false
  })
})

export default {
  name: "App",
  data() {
    return {
      data: data,
      activeIndex: 11
    };
  },
  components: {
    Province,
    City
  },
  methods: {
    changeActiveIndex(i) {
      this.activeIndex = i
    }
  }
};
</script>

<style>
* {
  margin: 0;
  padding: 0;
}

html,
body,
#app {
  width: 100%;
  height: 100%;
}

#app {
  display: flex;
}

</style>